 |
|
 |
Subject: Help with Lotus Script - copying the current view to another databases |
 |
 |
 |
Product Area: Domino Designer on Eclipse (DDE) |
 |
Technical Area: Application Development |
 |
Platform: Windows |
 |
Release: 8.5.2 |
 |
Reproducible: Always |
 |
 |
 |
 |
Hi all.
I need some help with Lotus Script - as I don't really know much! I've managed to piece together the script below by reading through various posts on this forum, and it works great.
The only problem is that I have to put the view name in to the code (Set view = db.getview("ABC1")
). I'd like it to always run this from the view that the user is currently in. Can someone please tell me how I can do this? I presume it's something to do with setting uiview, but I don't quite get this part yet...
Thanks!
Alex
Sub Initialize
Dim w As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim response As Variant
Dim results As Variant
Dim cmd As String
Dim session As New NotesSession
Dim db As NotesDatabase
Dim db2 As New NotesDatabase("myServer","Archive\\archive"&Trim(response)&".nsf")
'this is the name of the 2nd database
Dim view As NotesView
Dim doc As NotesDocument
Dim doc2 As NotesDocument
cmd = {@DbColumn("":"NoCache"; "MyDominoDirectoryRepID"; "Case Archives"; 1)}
results = Evaluate(cmd)
response = w.Prompt (PROMPT_OKCANCELLIST, "Select a Case Code", "Select a Case Code", results, results)
Set db = session.currentdatabase
Set view = db.getview("ABC1")
If view.name = "" Then Exit Sub
Set doc = view.getfirstdocument 'get the first doc in the folder
'check to make sure 2nd database is open, if not, open it
If Not (db2.isopen) Then
Call db2.open("myServer","Archive\\archive"&Trim(response)&".nsf")
End If
'Now get the rest of the documents from the folder and move it to the
'other database
Do
Set doc2 = doc.copytodatabase(db2)
Set doc = view.getnextdocument(doc)
Loop While Not (doc Is Nothing)
End Sub
 
Feedback number WEBB8C5JKX created by ~James Chugerovitchobu on 12/14/2010

Status: Open
Comments:

Help with Lotus Script - copying th... (~James Chugerov... 14.Dec.10)
. . use uiworkspace to get the current ... (~Ned Mintoolita... 14.Dec.10)
. . . . That worked - thanks very much! [EO... (~James Chugerov... 14.Dec.10) |
|  |
|